package com.kk.base.entity.home;

import com.kk.base.annotion.ValidateEntity;
import com.kk.base.entity.BaseEntity;
import lombok.Data;
import lombok.ToString;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;

/**
 * @info :  投诉实体类
 */
@Entity
@Table(name="complaint")
@EntityListeners(AuditingEntityListener.class)
@ToString
@Data
public class Complaint extends BaseEntity {

    public static final Integer NOTACCEPTED = 0;
    public static final Integer ACCEPTED = 1;

    @ManyToOne
    @JoinColumn(name="home_user_id")
    private HomeUser homeUser;  //投诉人

    @ValidateEntity(required=true,errorRequiredMsg="名字不能为空!")
    @Column(name="name")
    private String name; //投诉人名字

    @ValidateEntity(required=true,errorRequiredMsg="电话不能为空!")
    @Column(name="mobile")
    private String mobile; //投诉人电话

    @ValidateEntity(required=true,errorRequiredMsg="请选择您的身份!")
    @Column(name="home_user_type")
    private HomeUserTypeEnum homeUserType; //寄件人还是收件人

    @ValidateEntity(required=true,errorRequiredMsg="运单编号不能为空!")
    @Column(name="waybill_number")
    private String waybillNumber;  //运单编号

    @ValidateEntity(required=true,errorRequiredMsg="投诉内容不能为空!")
    @Column(name="content")
    private String content; //投诉内容

    @Column(name="status")
    private Integer status = NOTACCEPTED; //投诉状态 0未受理，1已受理

}
